package com.erp.order.supply.model;

import com.erp.hr.base.model.BaseModel;
import com.erp.order.purchasing.model.QuotedPriceDetail;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.math.BigDecimal;
import java.util.List;

@Data
@Entity
@DynamicInsert()
@DynamicUpdate()
@EqualsAndHashCode(callSuper = true)
@Table(name="supply_material_r", schema="erp")
public class SupplyMaterialR extends BaseModel {
    private static final long serialVersionUID = 1L;

    /**
     * 供货编码
     */
    @Column(name = "code")
    private String code;

    /**
     * 供货单id
     */
    @Column(name = "supply_material_id")
    private String supplyMaterialId;

    /**
     * 采购单id
     */
    @Column(name = "purchase_order_id")
    private String purchaseOrderId;
    /**
     * 小计
     */
    @Column(name = "total")
    private BigDecimal total;

    /**
     * 配送方式
     */
    @Column(name = "distribute_way")
    private String distributeWay;

    /**
     * 送货人
     */
    @Column(name = "send_user")
    private String sendser;

    /**
     * 送货人联系方式
     */
    @Column(name = "send_phone")
    private String sendPhone;

    /**
     * 预计送货时间
     */
    @Column(name = "send_time")
    private String sendTime;

    /**
     * 收货地址
     */
    @Column(name = "address")
    private String address;

    /**
     * 收货人
     */
    @Column(name = "receiver")
    private String receiver;

    /**
     * 收货人联系方式
     */
    @Column(name = "receiver_phone")
    private String receiverPhone;

    /**
     * 快递公司
     */
    @Column(name = "express_company")
    private String expressCompany;
    /**
     * 快递单号
     */
    @Column(name = "express_code")
    private String expressCode;
    /**
     * 是否开票
     */
    @Column(name = "is_invoice")
    private String isInvoice;

    /**
     * 发票类型
     */
    @Column(name = "invoice_type")
    private String invoiceType;
    /**
     * 税率
     */
    @Column(name = "taxrate")
    private String taxrate;
    /**
     * 状态
     */
    @Column(name = "status")
    private String status;

    /**
     * 物资报价详情集合
     */
    @Transient
    private List<SupplyMaterialDetail> supplyMaterialDetails;

}
